package main

import (
	"fmt"
	"gin-demo/Router"
	"gin-demo/dao/mysql"
	"os"
	"path/filepath"
)

// 获取当前可执行程序的路径 E:\Go\src\github.com\topaz-h\gin-demo\tmp
func getCurrentPath() string {
	if ex, err := os.Executable(); err == nil {
		return filepath.Dir(ex)
	}
	return "./"
}

func main() {
	mysql.Init()
	fmt.Println(getCurrentPath())
	defer Mysql.DB.Close()
	Router.InitRouter()
}
